/*
tID：任务ID
tNum：任务编码
tName:任务名称
tPoints:任务坐标点集合
tState:任务状态0：未分配；1，进行中；2，已完成
mapPolygon:任务区域对应的多边形
tGroupID:分配组ID
tGroupName：分配组名称
tGroupLeaderId：分配组组长ID
tGroupLeader：分配组组长名称
tArea：面积
tDivision：地区
**/

function fwsjcjTask(tID,tNum,tName,tPoints,tState,tType,tGroupID,tGroupName,tGroupLeaderId,tGroupLeader,tArea,tDivision){

    this.id=tID;
    this.taskNum=tNum;
    this.name=tName;
    this.points=[];
    if(tPoints!=null) {
        var pps = getTaskPoints(tPoints);
        this.points=pps;
    }
    this.state=tState;
    this.type=tType;
    this.mapPolygon=null;
    this.groupId=tGroupID;
    this.groupName=tGroupName;
    this.groupLeaderId=tGroupLeaderId;
    this.groupLeader=tGroupLeader;
    this.area=tArea;
    this.division=tDivision;
}

function getTaskPoints(tPoints){
    //alert(tPoints);
    var points2=[];
    var test=tPoints.split(/,|;/);
    for(var i=0;i<test.length;i++){
        var data=test[i];
        if(data==""){
            continue;
        }else {
            var ff = parseFloat(data);
            points2.push(ff);
        }
    }
    return points2;
}

/*
tID:房屋ID
tTaskID:任务ID
tTaskName:任务名称
tLng:房屋经度
tLat:房屋维度
tName:房屋名称
tFormID:表单ID
tTime:上报时间
tSPType:审批类型
tBuildType:建筑类型
**/
function fwsjcjFWInfo(tID,tTaskID,tTaskName,tLng,tLat,tName,tFormID,tTime,tSPType,tBuildType){
    this.id=tID;
    this.taskid=tTaskID;
    this.taskname=tTaskName;
    this.lon=tLng;
    this.lat=tLat;
    this.point=getFWPoint(tLng,tLat);
    this.name=tName;
    this.formid=tFormID;
    this.createtime=tTime;
    this.sptype=parseInt(tSPType);
    this.buildtype=parseInt(tBuildType);
}

function getFWPoint(tLng,tLat){
    var point=[];
    point.push(parseFloat(tLng));
    point.push(parseFloat(tLat));
    return point;
}

/*
tFootId:主键ID
tUserId:人员ID
tTaskId:任务ID
tLng:经度
tLat:维度
tCreateTime:创建时间
tRemark:备注
**/
function replayPersonPosition(tUserId,tTaskId,tLng,tLat,tCreateTime,tRemark){
    this.userId=tUserId;
    this.taskId=tTaskId;
    this.lon=parseFloat(tLng);
    this.lat=parseFloat(tLat);
    this.point=getFWPoint(tLng,tLat);
    this.createTime=tCreateTime;
    this.remark=tRemark;
}

/*
tID:房屋ID
tBuildType:建筑类型
tLng:房屋经度
tLat:房屋维度
tName:房屋名称
tBuildingTime:建造时间
tStructureType:结构类型
tHousePurpose:建筑用途
tBuildingLayerNum:建筑层数（地上）
tPresonNum:人口或户数
tNowFortificationIntensity:现抗震设防烈度
tResult:抗震设防初步结论
**/
function fwsjcjFWDetailinfos(tID,tBuildType1,tLng,tLat,tName,tBuildingTime,tStructureType,tHousePurpose,tBuildingLayerNum,tPresonNum,tNowFortificationIntensity,tResult,tSPType,tBuildType) {
    this.id=tID;
    this.lon=tLng;
    this.lat=tLat;
    this.point=getFWPoint(tLng,tLat);
    this.name=tName;
    this.buildingtime=tBuildingTime;
    this.structuretype=tStructureType;
    this.housepurpose=tHousePurpose;
    this.buildingupnum=tBuildingLayerNum;
    this.presonnum=tPresonNum;
    this.nowfortificationintensity=tNowFortificationIntensity;
    this.result=tResult;

    this.sptype=parseInt(tSPType);
    this.buildtype=0;
    if(tBuildType=="新增"){
        this.buildtype=1;
    }else if(tBuildType=="已拆除"){
        this.buildtype=2;
    }
    this.buildtype=tBuildType1;
    //this.buildtype=parseInt(tBuildType);
}

/*
tID:房屋ID
tType:房屋类型
tName:房屋名称
tBuildingTime:建造时间
tNowFortificationIntensity:现抗震设防烈度
**/
function fwsjcjFWImportantInfo(tID,tType,tName,tBuildingTime,tNowFortificationIntensity) {
    this.id = tID;
    this.type=tType;
    this.name=tName;
    this.buildingtime=tBuildingTime;
    this.nowfortificationintensity=tNowFortificationIntensity;
}